package com.xingu.xg.service;

import com.xingu.xg.mapper.TreeStructureMapper;
import com.xingu.xg.po.TreeStructure;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;

/**
 * @Author: 于卜
 * @ProjectName: xg-interview-java-master
 * @Package: com.xingu.xg.service
 * @ClassName: TreeStructureServiceImpl
 * @Description: TODO
 * @Date: 2024/5/15 13:30
 * @Version: 1.0
 */
@Service
public class TreeStructureServiceImpl implements TreeStructureService{
    @Resource
    private TreeStructureMapper treeStructureMapper;
    @Override
    public List<TreeStructure> get(Integer id) {
        List<TreeStructure> list = treeStructureMapper.get(id);

        return list;
    }

    @Override
    public boolean add(TreeStructure treeStructure) {
        int i = treeStructureMapper.add(treeStructure);
        if (i >0){
            return true;
        }
        return false;
    }

    @Override
    public boolean delete(Integer id) {
        int i = treeStructureMapper.delete(id);
        if (i >0){
            return true;
        }
        return false;
    }

}
